<?php

class PageView {

	private $m_charset;
	public static $title = "Labb3 + Labb4";

	/**
	 * Called when using new PageView();
	 * @param string $charset
	 **/
	public function __construct($charset = "utf-8") {
		$this -> m_charset = $charset;
	}

	public function Header($title) {

		return "
		<!DOCTYPE HTML>
		<html>
		<head>
		<meta charset='utf-8'/>
		<title>$title</title>
		<link rel=stylesheet href='style.css' type='text/css' ><link href='http://fonts.googleapis.com/css?family=Josefin+Slab' rel='stylesheet' type='text/css'></head>
		<body>
		<div id='wrapper'>
		<header id='header'>
		</header>";

	}

	public function Navigation() {
		return "<nav id='nav'></nav>";
	}

	public function Footer() {
		return "<footer id='footer'>
		</footer>
		</div>
		</body>
		</html>";
	}

	public function RenderHTMLPage($title, $body) {

		return $this->Header($title).$body.$this->Footer();
	}

	//Funktion som laddor om sidan
	public function RemoveGet() {
		$url = $_SERVER['REQUEST_URI'];
		$url = strtok($url, '?');
		header("Location: $url");
	}

}
